<script setup lang="ts">
import { RouterView } from 'vue-router'
import zhCN from 'ant-design-vue/es/locale/zh_CN'
import { onMounted } from 'vue'
import { useUserStore } from '@/stores/user'
import { useSettingsStore } from '@/stores/settings'

const userStore = useUserStore()
const settingsStore = useSettingsStore()

// 页面刷新之前重置当前路由
onMounted(() => {
  userStore.setCurrentPath('')
})
</script>

<template>
  <a-config-provider
    :locale="zhCN"
    :theme="{
      token: settingsStore.theme,
      components: settingsStore.componentsTheme
    }"
  >
    <router-view />
  </a-config-provider>
</template>

<style scoped></style>
